package com.xhwl.data.service;

import com.xhwl.common.dto.cent.sdata.RegionDTO;
import com.xhwl.common.pojo.cent.sdata.Region;
import com.xhwl.common.query.RegionQuery;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;
import java.util.List;

/**
 * @Author: luyi
 * @Description: 地区
 * @Date: Create in 11:20 2021/1/17
 */
@RestController
public interface IRegionService {

    /**
     * 根据id查询
     *
     * @param ids
     * @return
     */
    @RequestMapping(value = "/region-service/find-ids", method = RequestMethod.POST)
    List<Region> findByIds(@RequestPart Collection<Integer> ids);

    /**
     * 树查询
     *
     * @param query
     * @return
     */
    @RequestMapping(value = "/region-service/tree", method = RequestMethod.POST)
    List<RegionDTO> tree(@RequestPart(required = false) RegionQuery query);

    /**
     * 查询所有
     *
     * @param level
     * @return
     */
    @RequestMapping(value = "/region-service/get-all", method = RequestMethod.POST)
    List<Region> all(@RequestPart(value = "level", required = false) Integer level);

    /**
     * 查询列表
     *
     * @param query
     * @return
     */
    @RequestMapping(value = "/region-service/list", method = RequestMethod.POST)
    List<Region> list(@RequestPart(required = false) RegionQuery query);

    /**
     * 获取省市区名称
     * @param provincesId
     * @param cityId
     * @param districtId
     * @return
     */
    String getRegion(Integer provincesId, Integer cityId, Integer districtId);
}
